#pragma once

namespace XMLSAX
{
	namespace Common
	{
		class XMLElement;

		template <class T>
		class __declspec(dllexport) MemberFunctionPointer
		{
		public:
			typedef void (T::* CallbackFcn)(XMLElement *element);

			MemberFunctionPointer(T* object, CallbackFcn function)
			{
				pObject = object;
				pFcn = function;
			}

			void operator()(XMLElement *element)
			{
				((*pObject).*pFcn)(element);
			}

		private:
			T* pObject;
			CallbackFcn pFcn;
		};
	}
}